<?php

namespace Trois\MainServerRegister\Registers;

use EasySwoole\Component\Singleton;
use EasySwoole\Crontab\Exception\Exception;
use EasySwoole\EasySwoole\Swoole\EventRegister;
use Trois\Design\Observer\IObserver;

class DiRegister extends BaseRegister implements IObserver
{

    use Singleton;

    private $dis = [];

    private function __construct(EventRegister $register)
    {
        $this->dis = [
//            \Trois\Di\Area::class,
            \Trois\Di\AccessControlAllow::class,
        ];

        parent::__construct($register);
    }

    public function update()
    {
        foreach ($this->dis as $di) {
            try {
                $di::getInstance();
            } catch (Exception $e) {
            }
        }
    }


}